﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Admincp/Admin.Master" AutoEventWireup="true" CodeBehind="ContactUs.aspx.cs" Inherits="TPCN.Admincp.ContactUs" %>
<asp:Content ID="Head" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content" ContentPlaceHolderID="maincontent" runat="server">
    <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
        <Scripts>
            <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.Core.js" />
        </Scripts>
    </telerik:RadScriptManager>
    <asp:Panel ID="ButtonPanel" runat="server" CssClass="right">
        <asp:Button ID="btnInsert" runat="server" Text="Thêm danh mục" CssClass="button button-green"
            OnClick="btnInsert_Click" />
        <asp:Button ID="btnDelete" runat="server" Text="Xóa" CssClass="button button-green"
            OnClick="btnDelete_Click" />
    </asp:Panel>
    <asp:Panel ID="ErrorPanel" runat="server">
        <asp:ValidationSummary ID="summary" runat="server" CssClass="message error" />
    </asp:Panel>
    <hr />
    <asp:Panel ID="GridViewPanel" runat="server">
        <asp:GridView ID="ContactUsGridView" runat="server" AutoGenerateColumns="False" Width="100%"
            DataKeyNames="ContactUsID" Height="16px" 
            OnRowCommand="ContactUsGridView_RowCommand" AllowPaging="True"
            GridLines="None" CssClass="mGrid" AlternatingRowStyle-CssClass="alt" PagerStyle-CssClass="pgr"
            OnPageIndexChanging="DanmucGridView_PageIndexChanging" PageSize="3">
            <AlternatingRowStyle CssClass="alt" />
            <Columns>
                <asp:TemplateField>
                    <ItemTemplate>
                        <asp:CheckBox ID="chkSelect" runat="server" CssClass="chkItem" />
                    </ItemTemplate>
                    <HeaderTemplate>
                        <asp:CheckBox ID="chkSelectAll" runat="server" CssClass="chkHeader" />
                    </HeaderTemplate>
                    <HeaderStyle HorizontalAlign="Center" VerticalAlign="Middle" Width="30px" />
                    <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" Width="30px" />
                </asp:TemplateField>
                <asp:BoundField DataField="ContactUsID" ReadOnly="True">
                    <HeaderStyle CssClass="hide" />
                    <ItemStyle CssClass="hide" />
                </asp:BoundField>
                <asp:BoundField DataField="SenderName" HeaderText="Tên người gửi" />
                <asp:BoundField DataField="SenderEmail" HeaderText="Email" />
                <asp:BoundField DataField="Title" HeaderText="Tiêu đề" />
                <asp:BoundField DataField="Content" HeaderText="Nội dung" />
                <asp:BoundField DataField="Date" HeaderText="Ngày gửi" />
                <asp:CheckBoxField DataField="Active" HeaderText="Hiển thị" />
                <asp:TemplateField>
                    <ItemTemplate>
                        <asp:LinkButton ID="btn_CMD_Edit" runat="server" CommandArgument='<%# Eval("ContactUsID") %>'
                            CommandName="cmdEdit">Sửa</asp:LinkButton>
                        <asp:LinkButton ID="btn_CMD_Delete" runat="server" CommandArgument='<%# Eval("ContactUsID") %>'
                            CommandName="cmdDelete" onclientclick="return confirm('Bạn có muốn xóa sản phẩm này không?');">Xóa</asp:LinkButton>
                    </ItemTemplate>
                </asp:TemplateField>
            </Columns>
            <HeaderStyle HorizontalAlign="Left" />
            <PagerSettings FirstPageText="Đầu" LastPageText="Cuối" Mode="NumericFirstLast" NextPageText="Tiếp"
                PreviousPageText="Trước" PageButtonCount="5" />
            <PagerStyle CssClass="pgr" />
        </asp:GridView>
    </asp:Panel>
    <asp:Panel ID="EditFormPanel" runat="server">
        <table id="editForm">
            <tbody>
                <tr>
                    <td class="label">
                        Tên danh mục
                    </td>
                    <td>
                        <asp:TextBox ID="txtSenderName" runat="server" Width="230px"></asp:TextBox>
                        <asp:RequiredFieldValidator ID="requiredTenhang" runat="server" ControlToValidate="txtTenContactUs"
                            ErrorMessage="Tên danh mục không được để trống">*</asp:RequiredFieldValidator>
                    </td>
                    <td class="label">
                        Tiêu đề
                    </td>
                    <td>
                        <asp:TextBox ID="txtTitle" runat="server" Width="230px" TabIndex="4"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td class="label">
                        Mô tả tìm kiếm
                    </td>
                    <td>
                        <asp:TextBox ID="txtDescription" runat="server" TabIndex="6" Width="230px"></asp:TextBox>
                    </td>
                    <td class="label">
                        Từ khóa
                    </td>
                    <td>
                        <asp:TextBox ID="txtKeyword" runat="server" Width="230px" TabIndex="5"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td class="label">
                        Thứ tự
                    </td>
                    <td>
                        <asp:TextBox ID="txtThutu" runat="server" Width="230px" TabIndex="2"></asp:TextBox>
                        <asp:CompareValidator ID="compareThutu" runat="server" ControlToValidate="txtThutu"
                            ErrorMessage="Thứ tự phải là số và nguyên dương" Operator="GreaterThanEqual"
                            Type="Integer" ValueToCompare="0">*</asp:CompareValidator>
                    </td>
                    <td class="label">
                        Hiển thị</td>
                    <td>
                        <asp:CheckBox ID="chkActive" runat="server" TabIndex="7" />
                    </td>
                </tr>
                <tr>
                    <td class="label">
                        Chọn mặt hàng</td>
                        <td colspan="3">
                            <asp:ListBox ID="listHang" runat="server" Width="100%"></asp:ListBox>
                        </td>
                </tr>
                <tr>
                    <td colspan="4" class="center">
                        <asp:Button ID="btnSave" runat="server" Text="Cập nhật" CssClass="button button-green groupbutton"
                            OnClick="btnSave_Click" />
                        <asp:Button ID="btnCancel" runat="server" Text="Hủy bỏ" CssClass="button button-green groupbutton"
                            OnClick="btnCancel_Click" TabIndex="12" CausesValidation="False" UseSubmitBehavior="False" />
                    </td>
                </tr>
            </tbody>
        </table>
    </asp:Panel>
    <div class="clear">
    </div>
</asp:Content>
